package cn.xjfcloud.onedriveserver.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import cn.xjfcloud.onedriveserver.pojo.dto.UploadInfo;

@Mapper
public interface UploadInfoMapper {

	@Select(value = "select * from tbl_upload_info where upload_id = #{uploadId}")
	UploadInfo getUploadInfoByUploadId(String uploadId);
	
	@Insert(value = "insert into tbl_upload_info (upload_id,offset,total,upload_session,upload_time,api_config_id) values (#{uploadInfo.uploadId},#{uploadInfo.offset},#{uploadInfo.total},#{uploadInfo.uploadSession},#{uploadInfo.uploadTime},#{uploadInfo.apiConfigId})")
	Integer addUploadInfo(@Param("uploadInfo")UploadInfo uploadInfo);
	
	Integer updateUploadInfo(@Param("uploadInfo")UploadInfo uploadInfo);
	
	@Delete(value = "delete from tbl_upload_info where upload_id = #{uploadId}")
	Integer deleteUploadInfoByUploadId(@Param("uploadId") String uploadId);

}
